<?php
/*
 *  @author Nicolas Genevaux
 * (c)nige 2008
 */
	include_once($RACINE.'inc/fct.basedonnee.php');
	include_once($RACINE.'inc/fct.utils.php');
	include_once($RACINE.'inc/sql.matiere.php');
	include_once($RACINE.'inc/sql.inscritmatiere.php');
	include_once($RACINE.'inc/sql.matiereinscritmatiere.php');
	$res = doSQL($MATIEREINSCRITMATIERE_SELECT_INS,array(0=>$_SESSION['ID_CONECT'],1=>$_POST['idmat']));
	if($res['total']<=0) {
		redirect($PAGE_ACCUEIL_INSCRIT);
	}
	$res = doSQL($MATIERE_SELECT_ID,array(0=>$_POST['idmat']));
	$nomMatiere = $res['matiere'];
	if($_POST['accept'] == 2) {
		redirect($PAGE_ACCUEIL_INSCRIT);
	}
	else if($_POST['accept'] == 1) {
		doSQL($INSCRITMATIERE_DELETE,array(0=>$_SESSION['ID_CONECT'],1=>$_POST['idmat']));
		redirect($PAGE_ACCUEIL_INSCRIT);
	}
?>
